/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.interfaces.authorization;

import com.login.authorization.Person;
import java.util.Collection;
import org.springframework.security.access.annotation.Secured;
/**
 *
 * @author pgorzkowicz
 */
public interface PersonDAO {

    /**
     * Find person by id.
     */
    public Person findPersonById(Integer id);

    /**
     * Find persons.
     */
    public Collection<Person> findPersons();

    /**
     * Find persons using a start index and max number of results.
     */
    public Collection<Person> findPersons(final int startIndex, final int maxResults);

    /**
     * Find persons by last name.
     */
    public Collection<Person> findPersonsByLastName(String lastName);

    /**
     * Saves person.
     */
    public Person save(Person person);

    /**
     * Deletes person.
     */
    @Secured ({"ROLE_ADMIN"})
    public void delete(Person person);

}

